import axios from 'axios';
import { reqPost, reqGet, exportFile, loadFile } from './axiosFun';
/**
 * 商品管理
 **/
// 商品管理-获取商品管理列表
export const GoodsList = (params) => { return reqPost("post", "/api/Goods/list", params) };
// 商品管理-保存商品管理
export const GoodsSave = (params) => { return reqPost("post", "/api/Goods/save", params) };
// 商品管理-删除商品管理
export const GoodsDelete = (params) => { return axios.delete("/api/Goods/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };

/**
 * 客户管理
 */
//客户列表
export const customerList = (params) => { return reqGet("get", "/ocr/query/list", params).then(res => res.data) };
//修改用户
export const updateCustomer = (params) => { return reqPost("post", "/ocr/update/info", params) };
//添加用户
export const saveCustomer = (params) => { return reqPost("post", "/ocr/save/info", params) };
//删除用户
export const deleteCustomer = (params) => { return reqPost("post", "/ocr/delete/info", params) };
//导出用户数据
export const exportCustomer = (params) => { return exportFile("/ocr/export/list", params) };

/**
 * 评价管理
 */
//评价列表
export const evaluationList = (params) => { return reqGet("get", "/evaluation/query/list", params).then(res => res.data) };
//修改评价
export const updateEvaluation = (params) => { return reqPost("post", "/evaluation/update/info", params) };
//删除评价
export const deleteEvaluation = (params) => { return reqPost("post", "/evaluation/delete/info", params) };
//删除单个图片
export const deleteImgByPath = (params) => { return reqPost("post", "/evaluation/delete/img", params) };

/**
 * 获取图片
 */
export const getImg = (params) => { return loadFile("get", "/file", params).then(res => res) };

export const postList = (params) => { return reqPost("post", "/goods/list", params) };

//商品管理
export const saveGoods = (params) => { return reqPost("post", "/goods/save", params).then(res => res.data) };
export const goodsList = (params) => { return reqGet("get", "/goods/get/list", params).then(res => res.data) };
export const goodsDescById = (params) => { return reqGet("get", "/goods/get/detail", params).then(res => res.data) };